#include "herb.h"

Herb::Herb(const QString& name,int thermal,
           const QHash<QString,int>& maineff,
           const QHash<QString,int>& aideff,
           QString iconPath)
    :m_name(name),m_thermal(thermal),
     m_maineff(maineff),
     m_aideff(aideff),
     m_iconPath(iconPath){}

QHash<QString,int> Herb::geteff(const QString& role) const{
    if (role == "主药") return m_maineff;
    if (role == "辅药") return m_aideff;
    return QHash<QString,int>();
}

int Herb::thermal() const { return m_thermal; }
QString Herb::name() const { return m_name; }


